<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%lottery_setting}}".
 *
 * @property integer $id
 * @property integer $store_id
 * @property string $rule
 * @property string $title
 * @property string $type
 */
class PurchaseApply extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%purchase_apply}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['store_id'], 'integer'],
            [['name'], 'string', 'max' => 2000]
        ];
    }
	public function getUser()
    {
       return $this->hasOne(User::className(), ['id' => 'user_id']);
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
			'status'=>'状态',
            'store_id' => 'Store ID',
			'name' => '团长名称',
			'user_id' => '用户',
        ];
    }
}
